<input type="text" name="title" class="textinput" value="{$estate.title|sslash}" id="pageTitle" />
<fieldset>
	<legend>Eigenschaften</legend>
    <table border="0" cellspacing="5" cellpadding="5">
        <tr>
            <td><label>Bundesland:</label></td>
            <td>
                <select name="federal" class="smw" onchange="javascript:checkEstateType(this)">
                    {html_options options=$federals selected=$estate.federal_id}
                </select>
            </td>
            <td>&nbsp;</td>
            <td><label>Preis:</label></td>
            <td><input type="text" name="price" value="{$estate.price}" /></td>
        </tr>
        <tr>
            <td><label>Type:</label></td>
            <td>
                <select name="etype" class="smw" onchange="javascript:checkEstateType(this)">
                    {html_options options=$types selected=$estate.type_id}
                </select>
            </td>
            <td>&nbsp;</td>
            <td><label>Wohnfl&auml;che:</label></td>
            <td><input type="text" name="space" value="{$estate.space}" /></td>
            
        </tr>
        <tr>
            <td><label>Art:</label></td>
            <td>
                <select name="kind" class="smw">
                    {html_options options=$kinds selected=$estate.kind_id}
                </select>
            </td>
            <td>&nbsp;</td>
            <td><label>Zimmer:</label></td>
            <td>{html_options name=rooms options=$rooms selected=$estate.rooms}</td>
        </tr>
        <tr>
            <td><label>Adresse:</label></td>
            <td colspan="4"><input type="text" name="address" value="{$estate.address}" style="width: 360px;"></td>
        </tr>
        <tr>
            <td><label>PLZ:</label></td>
            <td><input type="text" name="zip" value="{$estate.zip}" size="12"></td>            
            <td>&nbsp;</td>
            <td><label>Ort:</label></td>
            <td><input type="text" name="city" value="{$estate.city}"></td>
            <td>&nbsp;</td>
        </tr>

        <tr>
            <td><label>Beziehbar ab:</label></td>
            <td colspan="4">
	            <input 	type="radio" 
	            		name="obtainable_instantly" 
	            		id="obtainable_instantly_yes" 
	            		value="1"
	            		onclick="display_obtainable_dates(false)"
	            		{if $estate.obtainable_instantly == 't'}checked="checked"{/if}/>
	            <label for="obtainable_instantly_yes">sofort</label>
	            <span style="margin-left: 17px;">
	            	<input 	type="radio" 
	            			name="obtainable_instantly" 
	            			id="obtainable_instantly_no" 
	            			value="0"
	            			onclick="display_obtainable_dates(true)"
	            			{if $estate.obtainable_instantly == 'f'}checked="checked"{/if}/>
	            	<label for="obtainable_instantly_no">ab: </label>
	                {html_select_date start_year=$current_year end_year=+8 reverse_years=true prefix='obtainable_' time=$estate.obtainable_at}            
                </span>
            </td>
        </tr>
        
    </table>
</fieldset>

{if $estate.obtainable_instantly == 't'}
<script type="text/javascript" language="javascript" charset="utf-8">
	document.observe("dom:loaded", function () {ldelim}
		display_obtainable_dates(false);
	{rdelim});
</script>
{/if}

<fieldset>
	<legend>Ausstattung</legend>
    <table border="0" cellspacing="5" cellpadding="5">
        <tr>
            <td><label>Zustand:</label></td>
            <td>
                <select name="state" class="smw">
                    {html_options options=$states selected=$estate.state_id}
                </select>
            </td>
            <td>&nbsp;</td>
            <td><label>Heizung:</label></td>
            <td>
                <select name="heating" class="smw">
                    {html_options options=$heatings selected=$estate.heating_id}
                </select>
            </td>
        </tr>
        <tr>
            <td><label>Fenster:</label></td>
            <td>
                <select name="window" class="smw">
                    {html_options options=$windows selected=$estate.window_id}
                </select>
            </td>
            <td>&nbsp;</td>
            <td><label>Boden:</label></td>
            <td>
                <select name="floor" class="smw">
                    {html_options options=$floors selected=$estate.floor_id}
                </select>
            </td>
        </tr>
        <tr>
            <td><label>Terrassen:</label></td>
            <td>
                <select name="terraces" class="smw">
                    {html_options options=$terraces selected=$estate.terraces}
                </select>
                <input name="terraces_sm" id="terraces_sm" type="text" size="3" value="{$estate.terraces_sm}" /> m&sup2;
            </td>
            <td>&nbsp;</td>
            <td><label>Balkone:</label></td>
            <td>
                {html_options name=balconies options=$balconies selected=$estate.balconies}
                <input name="balconies_sm" id="balconies_sm" type="text" size="3" value="{$estate.balconies_sm}" /> m&sup2;
            </td>
        </tr>
        <tr>
            <td><label>Loggia:</label></td>
            <td>
                <select name="loggias" class="smw">
                    {html_options options=$loggias selected=$estate.loggia}
                </select>
                <input name="loggia_sm" id="loggia_sm" type="text" size="3" value="{$estate.loggia_sm}" /> m&sup2;
            </td>
            <td>&nbsp;</td>
            <td><label>Kategorie:</label></td>
            <td>{html_options name=category options=$categories selected=$estate.category}</td>
        </tr>
        
        <tr>
            <td><label>M&ouml;blierung:</label></td>
            <td>
                <select name="accountrements" class="smw">
                    {html_options options=$accountrements selected=$estate.accountrements_id}
                </select>
            </td>            
            <td colspan="3">&nbsp;</td>
        </tr>
        
    </table>
</fieldset>


{if $referenceFolders}
<fieldset>
    <legend>Sichtbar in Referenzordner</legend>
    <ul class="referenceList">
    {foreach from=$referenceFolders item=folder key=fid name=rfloop}
		<li>
			<input 	type="hidden" 
					name="referenceFolders[{$fid}]" 
					value="0"
					>
    		<input  type="checkbox" 
                    name="referenceFolders[{$fid}]" 
                    value="1" 
                    id="rfolder_{$fid}"
                    {if $fid|in_array:$assignedReferenceFolders}checked=checked{/if}
                    >
            <label for="rfolder_{$fid}">{$folder}</label>
       </li>
    {/foreach}
    </ul>
</fieldset>
{/if}


<fieldset>
    <legend>Beschreibung</legend>
    <textarea id="elm1" name="content" rows="10" cols="40" class="tinymce mceEditor">
       {$estate.content|sslash|escape}
    </textarea>
</fieldset>

{* src="http://localhost/files/pages/104__1/image/80x60.jpg *}
<fieldset>
    <legend>Bilder</legend>

    <ul id="estatepictures">
            {foreach from=$pictures item=pic name=pic_loop}
            {if $estate.groundplan_id != $pic.id}
            <li id="estatepicture_{$pic.id}" style="position: relative">
                <a href="{$INA.root}{$filePath}image/{$pic.id}_square_100.jpg" target="_blank">
                    <img src="{$INA.root}{$filePath}image/{$pic.id}_square_100.jpg" class="liimg">
                </a>
                <br>
                <a href="javascript:dropEstatePic({$pic.id}, false);" class="image-delete">
                    <img src="{$INA.root}templates/admin/images/trash.gif" >
                </a>
                <img src="{$INA.root}templates/admin/images/drag_handle.gif" class="image-drag">
            </li>
            {/if}
            {foreachelse}
            no images uploaded yet
            {/foreach}
    </ul>
    <script type="text/javascript" charset="utf-8">
        {literal}
        Sortable.create("estatepictures", {
            handles:$$('#estatepictures a.image-drag'), 
            constraint:false,
            onUpdate: reorderEstatePictures
        });
        {/literal}
    </script>
    <div id="estatepicture_upload" class="cl">
        <table border="0" cellspacing="5" cellpadding="5">
            <tr>
                <td>Upload Image</td>
                <td>Fetch from URL</td>
            </tr>
            <tr>
                <td>
                    <table id="pictures">
                        <tr>
                            <td><input type="file" name="pictures[]" /></td>
                        </tr>
                    </table>
                    <small><a href="javascript: cloneRow('pictures')">Noch ein Bild hinzuf&uuml;gen</a></small>

                </td>
                <td>
                    <table id="read_pictures">
                        <tr>
                            <td><input type="text" name="read_pictures[]" style="width: 400px;" /></td>
                        </tr>
                    </table>
                    <small><a href="javascript: cloneRow('read_pictures')">Noch ein Bild hinzuf&uuml;gen</a></small>
                </td>
            </tr>
        </table>
    </div>
</fieldset>


<fieldset>
    <legend>Grundriss</legend>

    <ul id="estatepictures">
        {if $estate.groundplan_id}
            <li id="estatepicture_{$estate.groundplan_id}" style="position: relative">
                <a href="{$INA.root}{$filePath}image/{$estate.groundplan_id}_square_100.jpg" target="_blank">
                    <img src="{$INA.root}{$filePath}image/{$estate.groundplan_id}_square_100.jpg" class="liimg">
                </a>
                <br>
                <a href="javascript:dropEstatePic({$estate.groundplan_id}, true);" class="image-delete">
                    <img src="{$INA.root}templates/admin/images/trash.gif" >
                </a>
            </li>
        {/if}
    </ul>
    <div id="estategroundplan_upload" class="cl">
        <table border="0" cellspacing="5" cellpadding="5">
            <tr>
                <td>Upload Image</td>
                <td>Fetch from URL</td>
            </tr>
            <tr>
                <td>
                    <table id="groundplan">
                        <tr>
                            <td><input type="file" name="groundplan[]" /></td>
                        </tr>
                    </table>
                </td>
                <td>
                    <table id="read_pictures">
                        <tr>
                            <td><input type="text" name="read_groundplan[]" style="width: 400px;" /></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</fieldset>






